<?php
/**
 * Created by PhpStorm.
 * User: 17464
 * Date: 2020/1/3
 * Time: 16:37
 */

namespace App\Http\Transformers\Sms;

use App\Models\SmsSetting;
use League\Fractal\TransformerAbstract;

class GetDefaultSmsTransformer extends TransformerAbstract
{
    public function transform(SmsSetting $smsSetting)
    {
        $data = $smsSetting->toArray();

        $value = \GuzzleHttp\json_decode($data['value'], true);

        data_set($data, 'value', $value);

        return $data;
    }
}
